package com.livesource.client.web.sourceCode.edit;

import com.google.gwt.user.client.ui.ListBox;
import com.livesource.client.model.entry.ProjectClass;
import com.livesource.client.utilities.FeatureNameGenerator;

/**
 * 
 * @UserManual
 */
public class ClassStatusList extends ListBox {

	public ClassStatusList(String classStatus) {

		this.setWidth("100px");

		this.addItem("");

		this.addItem(FeatureNameGenerator.spacedName(ProjectClass.TODO_STATUS),
				ProjectClass.TODO_STATUS);

		this.addItem(
				FeatureNameGenerator.spacedName(ProjectClass.INPROGRESS_STATUS),
				ProjectClass.INPROGRESS_STATUS);

		this.addItem(
				FeatureNameGenerator.spacedName(ProjectClass.BLOCKED_STATUS),
				ProjectClass.BLOCKED_STATUS);

		if (ProjectClass.TODO_STATUS.equals(classStatus)) {

			this.setSelectedIndex(1);

		} else if (ProjectClass.INPROGRESS_STATUS.equals(classStatus)) {

			this.setSelectedIndex(2);

		} else if (ProjectClass.BLOCKED_STATUS.equals(classStatus)) {

			this.setSelectedIndex(3);
		}
	}
}
